package com.mgvlife.ddlw.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "tb_clazz")
public class Clazz {
	@Id
	@Column(length = 36, name = "id", unique = true)
	private String id;
	@Column(length = 10)
	private String grade;
	@Column(length = 200)
	private String major;
	@Column(length = 10, name = "clazznum")
	private String clazzNum;
	// 班级学生
	@OneToMany(targetEntity = Student.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<Student> students;
	// 对课次的关系
	@ManyToMany(targetEntity = Schedule.class, fetch = FetchType.LAZY)
	private List<Schedule> schedules;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	public String getClazzNum() {
		return clazzNum;
	}

	public void setClazzNum(String clazzNum) {
		this.clazzNum = clazzNum;
	}

	public List<Student> getStudents() {
		return students;
	}

	public void setStudents(List<Student> students) {
		this.students = students;
	}

	public List<Schedule> getSchedules() {
		return schedules;
	}

	public void setSchedules(List<Schedule> schedules) {
		this.schedules = schedules;
	}

}
